import superRequest from '@/utils/http/index'
import { IDataType } from '@/utils/http/types'

/** 字典列表(接口) */
export const apiGetDictList = async (code: string) => {
  return await superRequest.get<IDataType>({
    url: `/dict/getList?code=${code}`,
  })
}

/** 字典列表(接口) */
export const apiDictList = async (data: any) => {
  return await superRequest.post<IDataType>({
    url: '/dict/list',
    data,
  })
}

/** 字典新增(接口) */
export const apiDictAdd = async (data: any) => {
  return await superRequest.post<IDataType>({
    url: '/dict/add',
    data,
  })
}

/** 字典修改(接口) */
export const apiDictUpdate = async (data: any) => {
  return await superRequest.post<IDataType>({
    url: '/dict/update',
    data,
  })
}

/** 字典删除(接口) */
export const apiDictDelete = async (data: any) => {
  return await superRequest.post<IDataType>({
    url: '/dict/delete',
    data,
  })
}
